Optimal. Leaf size=183 \[ -\frac {4 \sqrt [4]{-1} a^2 (i A+B) \text {ArcTan}\left ((-1)^{3/4} \sqrt {\tan (c+d x)}\right )}{d}-\frac {4 a^2 (i A+B) \sqrt {\tan (c+d x)}}{d}+\frac {4 a^2 (A-i B) \tan ^{\frac {3}{2}}(c+d x)}{3 d}+\frac {4 a^2 (i A+B) \tan ^{\frac {5}{2}}(c+d x)}{5 d}-\frac {2 a^2 (9 A-11 i B) \tan ^{\frac {7}{2}}(c+d x)}{63 d}+\frac {2 i B \tan ^{\frac {7}{2}}(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{9 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.25, antiderivative size = 183, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 5, integrand size = 36, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.139, Rules used = {3675, 3673,
3609, 3614, 211} \begin {gather*} -\frac {4 \sqrt [4]{-1} a^2 (B+i A) \text {ArcTan}\left ((-1)^{3/4} \sqrt {\tan (c+d x)}\right )}{d}-\frac {2 a^2 (9 A-11 i B) \tan ^{\frac {7}{2}}(c+d x)}{63 d}+\frac {4 a^2 (B+i A) \tan ^{\frac {5}{2}}(c+d x)}{5 d}+\frac {4 a^2 (A-i B) \tan ^{\frac {3}{2}}(c+d x)}{3 d}-\frac {4 a^2 (B+i A) \sqrt {\tan (c+d x)}}{d}+\frac {2 i B \tan ^{\frac {7}{2}}(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{9 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 3609
Rule 3614
Rule 3673
Rule 3675
Rubi steps
\begin {align*} \int \tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^2 (A+B \tan (c+d x)) \, dx &=\frac {2 i B \tan ^{\frac {7}{2}}(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{9 d}+\frac {2}{9} \int \tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x)) \left (\frac {1}{2} a (9 A-7 i B)+\frac {1}{2} a (9 i A+11 B) \tan (c+d x)\right ) \, dx\\ &=-\frac {2 a^2 (9 A-11 i B) \tan ^{\frac {7}{2}}(c+d x)}{63 d}+\frac {2 i B \tan ^{\frac {7}{2}}(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{9 d}+\frac {2}{9} \int \tan ^{\frac {5}{2}}(c+d x) \left (9 a^2 (A-i B)+9 a^2 (i A+B) \tan (c+d x)\right ) \, dx\\ &=\frac {4 a^2 (i A+B) \tan ^{\frac {5}{2}}(c+d x)}{5 d}-\frac {2 a^2 (9 A-11 i B) \tan ^{\frac {7}{2}}(c+d x)}{63 d}+\frac {2 i B \tan ^{\frac {7}{2}}(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{9 d}+\frac {2}{9} \int \tan ^{\frac {3}{2}}(c+d x) \left (-9 a^2 (i A+B)+9 a^2 (A-i B) \tan (c+d x)\right ) \, dx\\ &=\frac {4 a^2 (A-i B) \tan ^{\frac {3}{2}}(c+d x)}{3 d}+\frac {4 a^2 (i A+B) \tan ^{\frac {5}{2}}(c+d x)}{5 d}-\frac {2 a^2 (9 A-11 i B) \tan ^{\frac {7}{2}}(c+d x)}{63 d}+\frac {2 i B \tan ^{\frac {7}{2}}(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{9 d}+\frac {2}{9} \int \sqrt {\tan (c+d x)} \left (-9 a^2 (A-i B)-9 a^2 (i A+B) \tan (c+d x)\right ) \, dx\\ &=-\frac {4 a^2 (i A+B) \sqrt {\tan (c+d x)}}{d}+\frac {4 a^2 (A-i B) \tan ^{\frac {3}{2}}(c+d x)}{3 d}+\frac {4 a^2 (i A+B) \tan ^{\frac {5}{2}}(c+d x)}{5 d}-\frac {2 a^2 (9 A-11 i B) \tan ^{\frac {7}{2}}(c+d x)}{63 d}+\frac {2 i B \tan ^{\frac {7}{2}}(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{9 d}+\frac {2}{9} \int \frac {9 a^2 (i A+B)-9 a^2 (A-i B) \tan (c+d x)}{\sqrt {\tan (c+d x)}} \, dx\\ &=-\frac {4 a^2 (i A+B) \sqrt {\tan (c+d x)}}{d}+\frac {4 a^2 (A-i B) \tan ^{\frac {3}{2}}(c+d x)}{3 d}+\frac {4 a^2 (i A+B) \tan ^{\frac {5}{2}}(c+d x)}{5 d}-\frac {2 a^2 (9 A-11 i B) \tan ^{\frac {7}{2}}(c+d x)}{63 d}+\frac {2 i B \tan ^{\frac {7}{2}}(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{9 d}+\frac {\left (36 a^4 (i A+B)^2\right ) \text {Subst}\left (\int \frac {1}{9 a^2 (i A+B)+9 a^2 (A-i B) x^2} \, dx,x,\sqrt {\tan (c+d x)}\right )}{d}\\ &=-\frac {4 \sqrt [4]{-1} a^2 (i A+B) \tan ^{-1}\left ((-1)^{3/4} \sqrt {\tan (c+d x)}\right )}{d}-\frac {4 a^2 (i A+B) \sqrt {\tan (c+d x)}}{d}+\frac {4 a^2 (A-i B) \tan ^{\frac {3}{2}}(c+d x)}{3 d}+\frac {4 a^2 (i A+B) \tan ^{\frac {5}{2}}(c+d x)}{5 d}-\frac {2 a^2 (9 A-11 i B) \tan ^{\frac {7}{2}}(c+d x)}{63 d}+\frac {2 i B \tan ^{\frac {7}{2}}(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{9 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 4.99, size = 315, normalized size = 1.72 \begin {gather*} \frac {\cos ^3(c+d x) \left (\frac {4 (i A+B) e^{-2 i c} \sqrt {-\frac {i \left (-1+e^{2 i (c+d x)}\right )}{1+e^{2 i (c+d x)}}} \tanh ^{-1}\left (\sqrt {\frac {-1+e^{2 i (c+d x)}}{1+e^{2 i (c+d x)}}}\right )}{\sqrt {\frac {-1+e^{2 i (c+d x)}}{1+e^{2 i (c+d x)}}}}-\frac {i \sec ^4(c+d x) (\cos (2 c)-i \sin (2 c)) (21 (84 A-89 i B)+140 (18 A-17 i B) \cos (2 (c+d x))+(756 A-791 i B) \cos (4 (c+d x))+30 (11 i A+8 B) \sin (2 (c+d x))+15 (17 i A+20 B) \sin (4 (c+d x))) \sqrt {\tan (c+d x)}}{1260}\right ) (a+i a \tan (c+d x))^2 (A+B \tan (c+d x))}{d (\cos (d x)+i \sin (d x))^2 (A \cos (c+d x)+B \sin (c+d x))} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.04, size = 298, normalized size = 1.63
method | result | size |
derivativedivides | \(\frac {a^{2} \left (-\frac {2 B \left (\tan ^{\frac {9}{2}}\left (d x +c \right )\right )}{9}+\frac {4 i B \left (\tan ^{\frac {7}{2}}\left (d x +c \right )\right )}{7}-\frac {2 A \left (\tan ^{\frac {7}{2}}\left (d x +c \right )\right )}{7}+\frac {4 i A \left (\tan ^{\frac {5}{2}}\left (d x +c \right )\right )}{5}+\frac {4 B \left (\tan ^{\frac {5}{2}}\left (d x +c \right )\right )}{5}-\frac {4 i B \left (\tan ^{\frac {3}{2}}\left (d x +c \right )\right )}{3}+\frac {4 A \left (\tan ^{\frac {3}{2}}\left (d x +c \right )\right )}{3}-4 i A \left (\sqrt {\tan }\left (d x +c \right )\right )-4 B \left (\sqrt {\tan }\left (d x +c \right )\right )+\frac {\left (2 i A +2 B \right ) \sqrt {2}\, \left (\ln \left (\frac {1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}{1-\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}\right )+2 \arctan \left (1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )+2 \arctan \left (-1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )\right )}{4}+\frac {\left (2 i B -2 A \right ) \sqrt {2}\, \left (\ln \left (\frac {1-\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}{1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}\right )+2 \arctan \left (1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )+2 \arctan \left (-1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )\right )}{4}\right )}{d}\) | \(298\) |
default | \(\frac {a^{2} \left (-\frac {2 B \left (\tan ^{\frac {9}{2}}\left (d x +c \right )\right )}{9}+\frac {4 i B \left (\tan ^{\frac {7}{2}}\left (d x +c \right )\right )}{7}-\frac {2 A \left (\tan ^{\frac {7}{2}}\left (d x +c \right )\right )}{7}+\frac {4 i A \left (\tan ^{\frac {5}{2}}\left (d x +c \right )\right )}{5}+\frac {4 B \left (\tan ^{\frac {5}{2}}\left (d x +c \right )\right )}{5}-\frac {4 i B \left (\tan ^{\frac {3}{2}}\left (d x +c \right )\right )}{3}+\frac {4 A \left (\tan ^{\frac {3}{2}}\left (d x +c \right )\right )}{3}-4 i A \left (\sqrt {\tan }\left (d x +c \right )\right )-4 B \left (\sqrt {\tan }\left (d x +c \right )\right )+\frac {\left (2 i A +2 B \right ) \sqrt {2}\, \left (\ln \left (\frac {1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}{1-\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}\right )+2 \arctan \left (1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )+2 \arctan \left (-1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )\right )}{4}+\frac {\left (2 i B -2 A \right ) \sqrt {2}\, \left (\ln \left (\frac {1-\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}{1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}\right )+2 \arctan \left (1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )+2 \arctan \left (-1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )\right )}{4}\right )}{d}\) | \(298\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 230, normalized size = 1.26 \begin {gather*} -\frac {140 \, B a^{2} \tan \left (d x + c\right )^{\frac {9}{2}} + 180 \, {\left (A - 2 i \, B\right )} a^{2} \tan \left (d x + c\right )^{\frac {7}{2}} + 504 \, {\left (-i \, A - B\right )} a^{2} \tan \left (d x + c\right )^{\frac {5}{2}} - 840 \, {\left (A - i \, B\right )} a^{2} \tan \left (d x + c\right )^{\frac {3}{2}} + 2520 \, {\left (i \, A + B\right )} a^{2} \sqrt {\tan \left (d x + c\right )} - 315 \, {\left (2 \, \sqrt {2} {\left (\left (i - 1\right ) \, A + \left (i + 1\right ) \, B\right )} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} + 2 \, \sqrt {\tan \left (d x + c\right )}\right )}\right ) + 2 \, \sqrt {2} {\left (\left (i - 1\right ) \, A + \left (i + 1\right ) \, B\right )} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} - 2 \, \sqrt {\tan \left (d x + c\right )}\right )}\right ) - \sqrt {2} {\left (-\left (i + 1\right ) \, A + \left (i - 1\right ) \, B\right )} \log \left (\sqrt {2} \sqrt {\tan \left (d x + c\right )} + \tan \left (d x + c\right ) + 1\right ) + \sqrt {2} {\left (-\left (i + 1\right ) \, A + \left (i - 1\right ) \, B\right )} \log \left (-\sqrt {2} \sqrt {\tan \left (d x + c\right )} + \tan \left (d x + c\right ) + 1\right )\right )} a^{2}}{630 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 555 vs. \(2 (145) = 290\).
time = 2.45, size = 555, normalized size = 3.03 \begin {gather*} \frac {315 \, \sqrt {-\frac {{\left (-i \, A^{2} - 2 \, A B + i \, B^{2}\right )} a^{4}}{d^{2}}} {\left (d e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \log \left (-\frac {2 \, {\left ({\left (A - i \, B\right )} a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} + \sqrt {-\frac {{\left (-i \, A^{2} - 2 \, A B + i \, B^{2}\right )} a^{4}}{d^{2}}} {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{{\left (-i \, A - B\right )} a^{2}}\right ) - 315 \, \sqrt {-\frac {{\left (-i \, A^{2} - 2 \, A B + i \, B^{2}\right )} a^{4}}{d^{2}}} {\left (d e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \log \left (-\frac {2 \, {\left ({\left (A - i \, B\right )} a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} - \sqrt {-\frac {{\left (-i \, A^{2} - 2 \, A B + i \, B^{2}\right )} a^{4}}{d^{2}}} {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{{\left (-i \, A - B\right )} a^{2}}\right ) - 2 \, {\left ({\left (1011 i \, A + 1091 \, B\right )} a^{2} e^{\left (8 i \, d x + 8 i \, c\right )} + 10 \, {\left (285 i \, A + 262 \, B\right )} a^{2} e^{\left (6 i \, d x + 6 i \, c\right )} + 42 \, {\left (84 i \, A + 89 \, B\right )} a^{2} e^{\left (4 i \, d x + 4 i \, c\right )} + 10 \, {\left (219 i \, A + 214 \, B\right )} a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (501 i \, A + 491 \, B\right )} a^{2}\right )} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}}{315 \, {\left (d e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - a^{2} \left (\int \left (- A \tan ^{\frac {5}{2}}{\left (c + d x \right )}\right )\, dx + \int A \tan ^{\frac {9}{2}}{\left (c + d x \right )}\, dx + \int \left (- B \tan ^{\frac {7}{2}}{\left (c + d x \right )}\right )\, dx + \int B \tan ^{\frac {11}{2}}{\left (c + d x \right )}\, dx + \int \left (- 2 i A \tan ^{\frac {7}{2}}{\left (c + d x \right )}\right )\, dx + \int \left (- 2 i B \tan ^{\frac {9}{2}}{\left (c + d x \right )}\right )\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.19, size = 194, normalized size = 1.06 \begin {gather*} \frac {\left (2 i - 2\right ) \, \sqrt {2} {\left (A a^{2} - i \, B a^{2}\right )} \arctan \left (-\left (\frac {1}{2} i - \frac {1}{2}\right ) \, \sqrt {2} \sqrt {\tan \left (d x + c\right )}\right )}{d} - \frac {2 \, {\left (35 \, B a^{2} d^{8} \tan \left (d x + c\right )^{\frac {9}{2}} + 45 \, A a^{2} d^{8} \tan \left (d x + c\right )^{\frac {7}{2}} - 90 i \, B a^{2} d^{8} \tan \left (d x + c\right )^{\frac {7}{2}} - 126 i \, A a^{2} d^{8} \tan \left (d x + c\right )^{\frac {5}{2}} - 126 \, B a^{2} d^{8} \tan \left (d x + c\right )^{\frac {5}{2}} - 210 \, A a^{2} d^{8} \tan \left (d x + c\right )^{\frac {3}{2}} + 210 i \, B a^{2} d^{8} \tan \left (d x + c\right )^{\frac {3}{2}} + 630 i \, A a^{2} d^{8} \sqrt {\tan \left (d x + c\right )} + 630 \, B a^{2} d^{8} \sqrt {\tan \left (d x + c\right )}\right )}}{315 \, d^{9}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 11.03, size = 326, normalized size = 1.78 \begin {gather*} \frac {4\,A\,a^2\,{\mathrm {tan}\left (c+d\,x\right )}^{3/2}}{3\,d}-\frac {A\,a^2\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\,4{}\mathrm {i}}{d}+\frac {A\,a^2\,{\mathrm {tan}\left (c+d\,x\right )}^{5/2}\,4{}\mathrm {i}}{5\,d}-\frac {2\,A\,a^2\,{\mathrm {tan}\left (c+d\,x\right )}^{7/2}}{7\,d}-\frac {4\,B\,a^2\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}}{d}-\frac {B\,a^2\,{\mathrm {tan}\left (c+d\,x\right )}^{3/2}\,4{}\mathrm {i}}{3\,d}+\frac {4\,B\,a^2\,{\mathrm {tan}\left (c+d\,x\right )}^{5/2}}{5\,d}+\frac {B\,a^2\,{\mathrm {tan}\left (c+d\,x\right )}^{7/2}\,4{}\mathrm {i}}{7\,d}-\frac {2\,B\,a^2\,{\mathrm {tan}\left (c+d\,x\right )}^{9/2}}{9\,d}+\frac {\sqrt {2}\,A\,a^2\,\ln \left (-4\,A\,a^2\,d+\sqrt {2}\,A\,a^2\,d\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\,\left (-2-2{}\mathrm {i}\right )\right )\,\left (1+1{}\mathrm {i}\right )}{d}-\frac {\sqrt {4{}\mathrm {i}}\,A\,a^2\,\ln \left (-4\,A\,a^2\,d+2\,\sqrt {4{}\mathrm {i}}\,A\,a^2\,d\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\right )}{d}+\frac {\sqrt {2}\,B\,a^2\,\ln \left (B\,a^2\,d\,4{}\mathrm {i}+\sqrt {2}\,B\,a^2\,d\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\,\left (-2+2{}\mathrm {i}\right )\right )\,\left (1-\mathrm {i}\right )}{d}-\frac {\sqrt {-4{}\mathrm {i}}\,B\,a^2\,\ln \left (B\,a^2\,d\,4{}\mathrm {i}+2\,\sqrt {-4{}\mathrm {i}}\,B\,a^2\,d\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________